#ifndef __GRUB_HEADER__
#define __GRUB_HEADER__

/*headers copied from http://www.gnu.org/software/grub/manual/multiboot/html_node/multiboot_002eh.html*/

struct multiboot_aout_symbol_table {
    unsigned int tabsize;
    unsigned int strsize;
    unsigned int addr;
    unsigned int reserved;
};
typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;


struct multiboot_elf_section_header_table {
    unsigned int num;
    unsigned int size;
    unsigned int addr;
    unsigned int shndx;
};
typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;



struct multibootInfo {
    /* Multiboot info version number */
    unsigned int flags;

    /* Available memory from BIOS */
    unsigned int memLower;
    unsigned int memUpper;

    /* "root" partition */
    unsigned int bootDevice;

    /* Kernel command line */
    unsigned int cmdline;

    /* Boot-Module list */
    unsigned int modsCount;
    unsigned int modsAddr;

    union {
        multiboot_aout_symbol_table_t aout_sym;
        multiboot_elf_section_header_table_t elf_sec;
    } u;

    /* Memory Mapping buffer */
    unsigned int mmapLength;
    unsigned int mmapAddr;

    /* Drive Info buffer */
    unsigned int drivesLength;
    unsigned int drivesAddr;

    /* ROM configuration table */
    unsigned int configTable;

    /* Boot Loader Name */
    unsigned int bootLoaderName;

    /* APM table */
    unsigned int apmTable;

    /* Video */
    unsigned int vbe_control_info;
    unsigned int vbe_mode_info;
    unsigned short vbe_mode;
    unsigned short vbe_interface_seg;
    unsigned short vbe_interface_off;
    unsigned short vbe_interface_len;
};
typedef struct multiboot_info multiboot_info_t;

struct multibootMemoryMapEntry {
    unsigned int size;
    unsigned long long addr;
    unsigned long long len;
#define MULTIBOOT_MEMORY_AVAILABLE              1
#define MULTIBOOT_MEMORY_RESERVED               2
    unsigned int type;
} __attribute__((packed));



#endif
